#ifndef __IS_BASE_OF_H__
#define __IS_BASE_OF_H__

namespace Boss
{

  template <typename TBase, typename TDerived>
  class IsBaseOf
  {
    IsBaseOf();
    ~IsBaseOf();
    struct Yes
    {
      char c[1];
    };
    struct No
    {
      char c[2];
    };
    static Yes Check(const TBase *);
    static No Check(const void *);
  public:
    enum { IsBase = sizeof(Check(static_cast<TDerived *>(0))) == sizeof(Yes) };
  };

}

#endif  // !__IS_BASE_OF_H__
